package com.lkd.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lkd.entity.OrderEntity;
import com.lkd.entity.TaskEntity;
import com.lkd.entity.TaskStatusTypeEntity;
import com.lkd.http.vo.CancelTaskViewModel;
import com.lkd.http.vo.TaskViewModel;
import com.lkd.vo.Pager;
import com.lkd.vo.PayVO;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 工单业务逻辑
 */
public interface TaskService extends IService<TaskEntity> {




    /**
     * 通过条件搜索工单列表
     * @param pageIndex
     * @param pageSize
     * @param innerCode
     * @param userId
     * @param taskCode
     * @param isRepair 是否是运维工单
     * @return
     */
    Pager<TaskEntity> search(Long pageIndex, Long pageSize, String innerCode, Integer userId, String taskCode, Integer status, Boolean isRepair, String start, String end);

    /**
     * 获取所有状态类型
     * @return
     */
    List<TaskStatusTypeEntity> getAllStatus();

//    boolean createTesk(TaskViewModel taskViewModel);
    boolean createTesk(TaskViewModel taskViewModel);

//    boolean accept(Long id);

    boolean accept(Long id);

    boolean cancelTask(Long id , CancelTaskViewModel cancelVM);
    boolean completeTask(long id);
    /**
     * 获取同一天内分配的工单最少的人
     * @param regionId
     * @param isRepair 是否是运维工单
     * @return
     */
    int getLeastUser(Long regionId, Boolean isRepair);

}
